import request from "@/util/request.js"


// 获取菜单的列表数据
export function getMenuList(params) {
    return request({
        url: "/api/System/menu/?" + params,
        method: "get"
    });
}

// 获取单个菜单详情，用于编辑回显
export function getMenu(id) {
    return request({
        url: "/api/System/menu/" + id + '/',
        method: "get",
    });
}

// 创建菜单
export function postMenu(data) {
    return request({
        url: "/api/System/menu/",
        method: "post",
        data
    });
}

// 修改菜单
export function putMenu(id,data) {
    return request({
        url: "/api/System/menu/" + id + '/',
        method: "put",
        data
    });
}

// 删除菜单
export function deleteMenu(id) {
    return request({
        url: "/api/System/menu/" + id + '/',
        method: "delete",
    });
}

// 获取上级菜单
export function getParentMenu(params) {
    return request({
        url: "/api/System/getParentMenu?" + params,
        method: "get",
    });
}
